From 9b0cb01573ef705fd2ad9fc1430d18f0c668e877 Mon Sep 17 00:00:00 2001 From: "emellor@ewan" Date: Fri, 23 Sep 2005 16:50:02 +0100 Subject: [PATCH] Move ImageHandler.create call to initDomain, after the call to xc.domain_create. This ensures that ImageHandler has the correct domain ID available to it, which seems sensible in general, and is necessary for the VMX VNC support in particular. Signed-off-by: Ewan Mellor --- tools/python/xen/xend/XendDomainInfo.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 8180eda9ac..384a8275c3 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -614,7 +614,7 @@ class XendDomainInfo: sxpr.append(['maxmem', self.info['maxmem_KiB'] / 1024]) if self.infoIsSet('device'): - for (n, c) in self.info['device']: + for (_, c) in self.info['device']: sxpr.append(['device', c]) def stateChar(name): @@ -706,13 +706,6 @@ class XendDomainInfo: """ # todo - add support for scheduling params? try: - if 'image' not in self.info: - raise VmError('Missing image in configuration') - - self.image = ImageHandler.create(self, - self.info['image'], - self.info['device']) - self.initDomain() # Create domain devices. @@ -737,6 +730,14 @@ class XendDomainInfo: self.domid = xc.domain_create(dom = self.domid or 0, ssidref = self.info['ssidref']) + + if 'image' not in self.info: + raise VmError('Missing image in configuration') + + self.image = ImageHandler.create(self, + self.info['image'], + self.info['device']) + if self.domid <= 0: raise VmError('Creating domain failed: name=%s' % self.info['name']) -- 2.30.2